package com.yhsoft.sys.controller;

import com.yhsoft.common.vo.Result;
import com.yhsoft.sys.controller.Response.SysContentOutVo;
import com.yhsoft.sys.controller.request.SysContentInVo;
import com.yhsoft.sys.service.ISysContentService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 平台内容配置 前端控制器
 * </p>
 *
 * @author yyyyyyyh
 * @since 2023-11-20
 */
@Api(tags = {"K-平台内容配置"})
@RestController
@RequestMapping("/sys/content")
public class SysContentController {

    @Autowired
    private ISysContentService iSysContentService;

    @ApiOperation("内容配置")
    @PostMapping("/set")
    public Result<?> set(@RequestBody SysContentInVo inVo){
        String msg = iSysContentService.set(inVo);
        return Result.success(msg);
    }

    @ApiOperation("获取平台内容配置")
    @GetMapping("/get")
    public Result<SysContentOutVo> get(){
        SysContentOutVo outVo = new SysContentOutVo();
        outVo = iSysContentService.getSysContent();
        return Result.success(outVo);
    }
}
